
import React, { useState, useRef, useEffect,Component } from 'react';
import {Input, message} from 'antd';
import { Button, Space } from 'antd';
import { PoweroffOutlined } from '@ant-design/icons';
import request from '@/utils/request';
import CreateForm from "@/pages/CommodityManagement/CommodityItems/components/CreateForm";
import {getRelation} from "@/pages/CommodityManagement/CommodityItems/service";

const IntegItemView = ({ handleOnchange, id,goodsInteg }) => {
  console.log(id);
  console.log(goodsInteg);
  const [GoodsIntegral, setGoodsIntegral] = useState();

  console.log(handleOnchange);
  const handleClick = () => {
    this.props.callback();
  };
  const handleChange = (event) => {
    console.log(event.target.value);
    setGoodsIntegral(event.target.value)
  };
  return (
    <div style={{textAlign:'center'}}>
      <Input placeholder="请输入此商品价值积分"
             defaultValue={goodsInteg}
             value={GoodsIntegral}
             onChange={handleChange}/>
      <Button
        style={{marginTop:'20px'}}
        type="primary"
        onClick={handleClick.bind(this)}
      >
        确定
      </Button>
    </div>
  );
};

export default IntegItemView;
